home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MIDICraft's MIDINET CD-ROM
/
MIDICraft's MIDINET CD-ROM.iso
/
DOSUTILS
/
MIDI2GM.DOC
< prev
next >
Wrap
Text File
|
1996-09-22
|
10KB
|
249 lines
******************************
MIDIKORG v1.4
midi binaries to general midi
by Guenter Nagler
1995
(gnagler@ihm.tu-graz.ac.at)
******************************
[0] FEATURES
+ reads a binary midi file
+ writes a binary midi file
+ removes program changes and bank selections in channel 10
+ shows all changes done to the file
+ can map channel numbers
+ initializes korg i2/i3 programs and banks to GM
+ converts korg i2/i3 midi to GM (inserts reverb, chorus)
[1] BACKGROUND
I am using a Korg i3 music workstation and had some problems with
some midi files. The instrument recognizes a drum at channel 10
only if no program change at this channel is done or a drum channel
selection is done. First I tried to change the drum channel manually
at the instrument switches. I automatized this process by playing an
initialization midi (containing only program changes and bank selections)
before playing the music file.
This solution does not work if there are some bank selection or
program changes inside the song part.
For these cases I used my programs MIDI2TXT and TXT2MIDI to manually
edit the commands that confused my machine.
I found that the changes done in these files are so minimal that
it could be easily done automatically. Once I found a correct karaoke
midi that korg i3 could not play (some of the lyrics may have confused
the instrument) so I added an option (-notext) to ignore the textual
meta events.
Originally I called the program MIDIKORG for exclusive use with my
instrument. Later I noticed that that the program only does minor Korg
dependent modifications and only if a korg dependent option is set.
So I changed the name to the name MIDI2GM for general use.
[2] FILES DESCRIPTION
MIDI2GM.EXE.........converter program
MIDI2GM.DOC.........this file, showing usage of MIDI2GM.EXE
MIDIIO.HPP..........header file for a c++ midi parser
MIDIIO.CPP..........source code for a c++ midi parser
MIDI2GM.CPP.........c++ source code for modifying midi files
MIDI2GM.MAK.........make file for project
MIDI2GM.CFG.........compiler options for make
MIDI2GM.PRJ.........compiler project for Borland (tm) c++ compilers
only MIDI2GM.EXE is required to run program
[3] COPYRIGHT
MIDI2GM (c) 1995 was created by Guenter Nagler.
MIDI2GM is free and may be used as you wish with this one exception:
You may NOT charge any fee or derive any profit for distribution
of MIDI2GM. Thus, you may NOT sell or bundle MIDI2GM with any
product in a retail environment (shareware disk distribution, CD-ROM,
etc.) without permission of the author.
You may give MIDI2GM to your friends, upload it to a BBS, or ftp it to
another internet site, as long as you don't charge anything for it.
[4] DISCLAIMER
MIDI2GM was designed to handle 100% compatible midi files.
It was tested with 600 different midi files but I can not say if
each 100% midi compatible midi file can be correctly converted.
So I give no guarantees of the results, especially with non 100%
compatible midi files.
If you find a midi file that you think to be 100% compatible midi
that is not correctly converted, please send a sample file to
gnagler@ihm.tu-graz.ac.at .
Use MIDI2GM at your own risk. Anything you do with MIDI2GM is your
responsibility, and not the author's. Any damage caused to any person,
computer, software, hardware, company, or business by running MIDI2GM
is your responsibility, and the author will not be liable.
If you don't understand these terms, or are not sure of something, or
are afraid something bad might come of using MIDI2GM, don't use it!
You are here forewarned.
[5] INSTALLATION
[MSDOS]
Simply copy MIDI2GM.EXE in a directory that is in your path.
When you start the program without arguments
[UNIX]
compile sources with your C++ compiler (e.g. GNU Compiler g++):
g++ -o midi2gm midi2gm.cpp midiio.cpp
and run program
$ midi2gm
C:\> MIDI2GM
you should get the usage text (see next section)
[6] USAGE
usage: MIDI2GM [-i3][-q][-notext][-nosys][-nonote #[-#]][-nobend #[-#]][-mapchannel #[-#] #] midifile.mid gmfile.mid
The parts in brackets [...] are optional.
The program MIDI2GM allows following option:
-version get program version
-i3 initializes all tracks with default GM-programs and
selects according banks (should only be used for Korg i2/i3)
-q be quiet, program does not show the changes
-notext ignore all textual information (tracknames, lyrics)
-nosys ignore all sysex events
-nonote #[-#] ignore all note on/off events on channel # (1-16) or on
channels between # and # (both between 1-16 and first number less or equal second number)
-nobend #[-#] ignore all pitch bend events on channel # (1-16) or on
channels between # and # (both between 1-16 and first number less or equal second number)
-mapchannel #[-#] # map all channel dependent commands from channels #-# to channel #
(first #-# (1-16) are source, second # (1-16) is destination)
MIDI2GM produces a copy of the input midi if no changes are necessary!
Warning:
Do not expect that MIDI2GM will produce a copy of the original
file! MIDI allows to encode its commands in different ways without
changing the semantic of the notes (It is allowed to compress the
midi file by ommiting redunant command bytes, but it is no duty).
MIDI2GM only compresses note on/off command bytes for higher
compatibility.
[8] SUGGESTIONS / COMMENTS / BUG REPORTS / QUESTIONS
WWW: http://hgiicm.tu-graz.ac.at/Cpub
contains all my dos/unix midi programs
EMAIL: gnagler@ihm.tu-graz.ac.at
[9] USE
I always use MIDI2GM in a dos batch file MIDI.BAT that produces temporary
midi file that is played with my dos sound player:
midi.bat:
midi2gm -i3 %1 temp.mid
playmidi temp.mid
del temp.mid
I use this batch by entering
midi filename.mid
example: map drum channel from extended midi to general midi
midi2gm -map 16 10 original.mid copy.mid
example: map a list of drum channels used on channels 10-16 to general midi
midi2gm -map 10-16 10 original.mid copy.mid
example: map channels of a non-gm midi without producing a gm compatible
midi file
midi2gm -map 5 1 -map 4 2 -map 2 4 -map 1 5 -notbank original.mid mapped.mid
example: generate a midi that you can play channel 4 by yourself with keyboard
and rest by midi ensemble.
midi2gm -nonote 4 -notbank original.mid without4.mid
example: you own a korg i2 or i3 and created your korg song with song
internal sequencer a korg.sng, the example shows how to generate a
gm midi (the conversion uses korg additional information found in
a parameter table).
1. load the song korg.sng into the sequencer (e.g. song 0)
save the song 0 as format 1 midi into korg.mid on a floppy disk.
2. put the floppy disk to your computer where you have installed
the midi2gm program.
3. enter the command
midi2gm korg.mid korggm.mid
use option -map to map extra drum channels that are not on channel 10
to channel 10 (e.g. percussion/drums on channels 11, 12, 13) :
midi2gm -map 11 10 -map 12 10 -map 13 10 korg.mid korggm.mid
Hint: You could use midi2txt and txt2midi (available at WWW location
in [8]) to manually add the
song title and composer
trackname "title of the song (by composer, artist)"
copyright of the song
copyright "(c) year my name"
(both only in first track, that is the tempo track),
lyrics to the song
lyric "line of song text"
(can use many lyric commands, e.g. one for each phrase,
add it in first track or in the track that contains the vocal notes,
you could add it at the place where the according notes are played
or use a karaoke midi program to add the synchronized lyrics).
instrumentation and intention of tracks
trackname "guitar for solo in middle part"
(add it to each track that plays notes, or change already existing
trackname lines e.g. trackname "Track01").
Hint: You could use midifade (see [8]) to fade in or fade out parts of
the song.
[10] CHANGES
v1.0 to v1.1:
* added -nosys command to ignore all sysex commands
* some portability changes for UNIX compatibility
v1.1 to v1.2:
* added -nonote command to mute all notes of a certain channel
* added -mapchannel command to change channel numbers
* automatic channel mapping to GM drum channel 10 when certain
drum specific keywords (e.g. Hi-hat, drums, snare ...) are
recognized in trackname of a track (only format 1 midi)
v1.2 to v1.3
* midiio engine writes less compressed but safer files (more compatibility
to weak midi readers)
* recognizes korg i2/i3 meta event for song parameter initialization
(for conversion between korg i2/i3 midi and GM)
v1.3 to v1.4
* program name changed from MIDIKORG to MIDI2GM
* option -notbank added so that automatic removing bank selection commands
can be suppressed (e.g. for channel mapping only).
* option -nonote allows range of midi channels e.g. -nonote 1-9 11-16
v1.4 to v1.5
* added option -version
* simplified program by using class MidiCopy for modifying midi files
v1.5 to v1.6
* added initialization of i2/i3 (option) in case of
guessing drums not on channel 10
* option -map enhanced by allowing source channel ranges
e.g. -map 11-16 10 is same as
-map 11 10 -map 12 10 -map 13 10 -map 14 10 -map 15 10 -map 16 10
* added options for initializing XG, GM, GS
* fixed problems with special sysex commands